#include <isa.h>

word_t isa_raise_intr(word_t NO, vaddr_t epc) {
  /* TODO: Trigger an interrupt/exception with ``NO''.
   * Then return the address of the interrupt/exception vector.
   */
  cpu.csr[1] = epc;//mepc
//  printf("mepc:%lx\n",cpu.csr[1]);
  cpu.csr[3] = 11; //mcause
//printf("mcause:%lx\n",cpu.csr[3]);
  //  printf("mtvec:%lx,cpu.pc:%lx\n",cpu.csr[0],cpu.pc);
  cpu.pc = cpu.csr[0]; //mtvec
//  printf("mtvec:%lx,cpu.pc:%lx\n",cpu.csr[0],cpu.pc);
#ifdef CONFIG_ETRACE
  Log("exception with NO:%ld",NO);
#endif
  return cpu.csr[0];
}

word_t isa_query_intr() {
  return INTR_EMPTY;
}
